using System.Collections.Generic;

namespace SharedObjects
{
	/// <summary>
	/// A Task is a section of objectives inside a story arc.
	/// </summary>
	public class StoryTask : StoryBase
	{
		/// <summary>
		/// This is the reference back to the arc that this task belongs to
		/// </summary>
		public StoryArc StoryArc { get; set; }

		/// <summary>
		/// This list of conditions will be checked, once a task is complete.
		/// </summary>
		public List<ObjectiveCondition> LaunchConditions { get; set; }

		public TaskState State { get; set; }

		/// <summary>
		/// This points to the target system (if static) or flags the target to be a dynamic instance.
		/// All dependent description will have this system mentioned in their descriptions
		/// </summary>
		public StoryTaskTarget Target { get; set; } 
		

		/// <summary>
		/// List of parallel objectives for this task.
		/// Only one objective can be "visible" to the user. If more than one visible objective exists -> Server error. 
		/// If no visible objective exists -> Server error (MAYBE! we could allow all-invisible objectives if creator wants a mission to be completely description based,
		/// ie. the user should abstract the objectives from the description, not the spoon-feeding of the objective display).
		/// 
		/// Note: All objectives are concurrent.
		/// </summary>
		public List<StoryTaskObjective> Objectives { get; set; }
	}

	public class ObjectiveCondition
	{
		public StoryTask TaskId { get; set; }					//Which task are we looking at?
		public StoryTaskObjective Objective { get; set; }	//Which objective is relevant for this condition?
		public bool MustBeCompleted { get; set; }
		public bool MustBeSuccessful { get; set; }
	}
}